package lab03.test4;

import java.io.*;
import java.nio.Buffer;

public class Test4 {
    public static void main(String[] args)  {
        String path="D:\\source.txt";
        String path1="D:\\target.txt";
        FileInputStream fileInputStream=null;
        FileOutputStream fileOutputStream=null;
        try {
            fileInputStream=new FileInputStream(path);
            fileOutputStream=new FileOutputStream(path1);
            int tem=-1;
            while ((tem=fileInputStream.read())!=-1){
                fileOutputStream.write(tem);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        finally {
            try {
                fileInputStream.close();
                fileOutputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
